<template>
<div class="home">
  <button v-on:click="changeName">修改name</button>
  <button v-on:click="incrementLevel">递增level</button>
  <button @click="changeInfo">修改info</button>
  <h2>
    Store Name:{{$store.state.name}}
  </h2>
  <h2>
    Store Level:{{$store.state.level}}
  </h2>
</div>
</template>

<script>
import {CHANGE_INFO} from '@/store/mutation_types'
export default{
  computed:{

  },
  methods:{
    changeName(){
      this.$store.commit('changeName','dingjie')
    },
    incrementLevel(){
      this.$store.commit('incrementLevel')
    },
    changeInfo(){
      this.$store.commit(CHANGE_INFO,{
        name:'王二',
        level:234
      })
    }
  }
}

</script>



<style scoped>

</style>